package com.ruiysoft.pub.anno;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.util.concurrent.TimeUnit;

/**
 * 重复请求锁
 * Date : 2019/1/16
 *
 * @author WenJialu
 */
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@Inherited
@Documented
public @interface DuplicateLock {
	/**
	 * 锁key: EL expression or String
	 * @return
	 */
	String key();
	String userId() default "";

	/**
	 * 锁过期时间
	 * @return
	 */
	long expire() default 10L;

	/**
	 * 时间单位
	 * @return
	 */
	TimeUnit timeUnit() default TimeUnit.SECONDS;
}
